package com.zhou.framework.quartz.dto;

import com.zhou.util.TimeUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author lang.zhou
 * @since 2023/2/21
 */
@Data
public class JobPageDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String triggerName;

    private String jobName;
    private String jobGroup;
    private String triggerGroup;
    private Date startTime;
    private Date nextFireTime;
    private Date prevFireTime;
    private String triggerState;
    private String triggerType;
    private String cronExpression;
    private String jobClassName;

    public void setStartTime(Long startTime) {
        if(startTime != null){
            this.startTime = new Date(startTime);
        }
    }

    public void setNextFireTime(Long nextFireTime) {
        if(nextFireTime != null){
            this.nextFireTime = new Date(nextFireTime);
        }
    }

    public void setPrevFireTime(Long prevFireTime) {
        if(prevFireTime != null){
            this.prevFireTime = new Date(prevFireTime);
        }
    }
}
